package larrys.pomodoro.util;

final public class AssertUtil {

	public static void argumentNotNull(Object argument, String argumentName) {
		if (argument == null) {
			throw new IllegalArgumentException("Argument:[" + argumentName
					+ "] CANNOT be null!");
		}
	}

	public static void validId(long id) {
		if (id <= 0) {
			throw new IllegalArgumentException(
					"Id: CANNOT be equal or less then 0!");
		}
	}

	public static void notNull(Object object, String message) {
		if (object == null) {
			throw new IllegalArgumentException(message);
		}
	}

	public static void propertyShouldNotBeNull(Object object, String beanName,
			String propertyName) {
		if (object == null) {
			throw new IllegalArgumentException(beanName + "'s property:["
					+ propertyName + "] SHOULD NOT be null!");
		}
	}
}
